<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page session="false" %>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>Home</title>
</head>
<body>
	<div align="center">
		<h1>List Employee</h1>
		<h2><a href="newEmployee">Create New Employee</a></h2>
		<table border="1">
			<tr>
				<th>Id</th>
				<th>Name</th>
				<th>Position</th>
				<th>Birthday</th>
				<th>Id Department</th>
				<th>Edit</th>
				<th>Delete</th>
			</tr>
			<c:forEach var="ep" items="${EmployeeList}">
			<tr>
				<td>${ep.id}</td>
				<td>${ep.name}</td>
				<td>${ep.position}</td>
				<td>${ep.birthday}</td>
				<td>${ep.department.name}</td>
				<td><a href="edit?table=ep&id=${ep.id}">Edit</a></td>
				<td><a href="delete?table=ep&id=${ep.id}">Delete</a></td>
			</tr>
			</c:forEach>
		</table>
	</div>
	
	<div align="center">
		<h1>List Department</h1>
		<h2><a>Create New Department</a></h2>
		<table border="1">
			<tr>
			 	<th> Id </th>
				<th> Name </th>
				<th> Foundation Date </th>
				<th> Edit </th>
				<th> Delete</th>
			</tr>
			<c:forEach var="dp" items="${DepartmentList}">
				<tr>
					<td>${dp.id}</td>
					<td>${dp.name}</td>
					<td>${dp.foundationdate}</td>
					<td><a href="edit?table=dp&id=${dp.id}">Edit</a></td>
					<td><a href="delete?table=dp&id=${dp.id}">Delete</a></td>
				</tr>
			</c:forEach>
		</table>
	</div>
</body>
</html>
